<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>主菜单</title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<script src="js/mui.min.js"></script>
		<script src="js/addressinitialization.js"></script>
		<link rel="stylesheet" href="css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="css/mainPage.css" />
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			window.onload = function() {
				startinventory(); //开始盘点
			}

			//      开始盘点
			function startinventory() {
				document.getElementById("startinventory").addEventListener("click", function() {
					window.location = "startinventory.html";
				});
			}

			//首页返回键处理
			//处理逻辑：1秒内，连续两次按返回键，则返回登陆；
			var first = null;
			mui.back = function() {
				//首次按键，提示‘再按一次退出应用’
				if (!first) {
					first = new Date().getTime();
					mui.toast('再按一次返回登陆');
					setTimeout(function() {
						first = null;
					}, 1000);
				} else {
					if (new Date().getTime() - first < 1000) {
						plus.runtime.restart();
					}
				}
			};
		</script>
	</head>
	<!--主菜单-->
	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">首页</h1>
		</header>
		<div class="mui-content">
			<div id="slider" class="mui-slider">
				<div class="mui-slider-group mui-slider-loop">
					<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a href="#">
							<img src="https://picsum.photos/id/1/400/300">
						</a>
					</div>
					<!-- 第一张 -->
					<div class="mui-slider-item">
						<a href="#">
							<img src="https://picsum.photos/id/10/400/300">
						</a>
					</div>
					<!-- 第二张 -->
					<div class="mui-slider-item">
						<a href="#">
							<img src="https://picsum.photos/id/100/400/300">
						</a>
					</div>
					<!-- 第三张 -->
					<div class="mui-slider-item">
						<a href="#">
							<img src="https://picsum.photos/id/1009/400/300">
						</a>
					</div>
					<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
					<div class="mui-slider-item mui-slider-item-duplicate">
						<a href="#">
							<img src="https://picsum.photos/id/1/400/300">
						</a>
					</div>
				</div>
				<div class="mui-slider-indicator">
					<div class="mui-indicator mui-active"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
					<div class="mui-indicator"></div>
				</div>
			</div>
		</div>


	</body>
	<!--主菜单结束-->
</html>
<script type="text/javascript">
	mui.plusReady(function() {
		/*监听手机的返回键*/
		if ('Android' == plus.os.name) {
			var first = null;
			mui.back = function() {
				if (!first) {
					first = new Date().getTime();
					mui.toast('再按一次退出应用');
					setTimeout(function() {
						first = null;
					}, 1000);
				} else {
					if (new Date().getTime() - first < 1000) {
						plus.runtime.quit();
					}
				}
			}
		}
	})
</script>
